package com.xunkids.bos.migration.component.log;


import com.xunkids.bos.migration.component.log.impl.Log4j2LogService;
import org.slf4j.Logger;
import org.springframework.boot.autoconfigure.AutoConfigureOrder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;

/**
 * 日志公共配置
 *
 * @author baiyanlong
 * @version 1.0.0
 * @since 2022/11/4 10:45
 */
@Configuration(proxyBeanMethods = false)
@AutoConfigureOrder(value = Ordered.LOWEST_PRECEDENCE)
public class MigrationLogComponentConfiguration {

    private static final Logger logger = LoggerHelp.getLogger("bosDataMigrationSys");

//    private final static String prefix = "bosDataMigrationSys.log";

    /**
     * 内存日志
     *
     * @return LogService
     */
    @Bean("logService")
    public LogService memSuperLogService() {
        Log4j2LogService service = new Log4j2LogService(16, Runtime.getRuntime().availableProcessors());
        if (logger.isInfoEnabled()) {
            logger.info("init log component Log4j2  success");
        }
        return service;
    }




}
